.class public final Lnbisdk/qz;
.super Ljava/lang/Object;


# static fields
.field private static final xO:Ljava/lang/Object;


# instance fields
.field private dJ:Landroid/content/Context;

.field private xP:Landroid/database/sqlite/SQLiteDatabase;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lnbisdk/qz;->xO:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lnbisdk/qz;->dJ:Landroid/content/Context;

    iget-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v0, :cond_1

    sget-object v0, Lnbisdk/qz;->xO:Ljava/lang/Object;

    monitor-enter v0

    :try_start_0
    iget-object v1, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v1, :cond_0

    :try_start_1
    iget-object v1, p0, Lnbisdk/qz;->dJ:Landroid/content/Context;

    const-string v2, "NIMSTORE.db"

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-virtual {v1, v2, v3, v4}, Landroid/content/Context;->openOrCreateDatabase(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    iput-object v1, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    iget-object v1, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/database/sqlite/SQLiteDatabase;->setVersion(I)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Landroid/database/sqlite/SQLiteException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_1

    :cond_0
    :goto_0
    :try_start_2
    monitor-exit v0

    :cond_1
    return-void

    :catch_0
    move-exception v1

    invoke-direct {p0}, Lnbisdk/qz;->kM()V

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw v1

    :catch_1
    move-exception v1

    const/4 v2, 0x0

    :try_start_3
    iput-object v2, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    new-instance v2, Lnbisdk/an;

    invoke-direct {v2, v1}, Lnbisdk/an;-><init>(Ljava/lang/Exception;)V

    throw v2
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0
.end method

.method private kM()V
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnbisdk/an;
        }
    .end annotation

    const/4 v4, 0x0

    :try_start_0
    iget-object v0, p0, Lnbisdk/qz;->dJ:Landroid/content/Context;

    const-string v1, "NIMSTORE.db"

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/Context;->openOrCreateDatabase(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    iget-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/database/sqlite/SQLiteDatabase;->setVersion(I)V
    :try_end_0
    .catch Landroid/database/sqlite/SQLiteException; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    :catch_0
    move-exception v0

    iput-object v4, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    new-instance v1, Lnbisdk/an;

    invoke-direct {v1, v0}, Lnbisdk/an;-><init>(Ljava/lang/Exception;)V

    throw v1
.end method


# virtual methods
.method public final close()V
    .locals 1

    iget-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v0}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    const/4 v0, 0x0

    iput-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    :cond_0
    return-void
.end method

.method public final getDatabase()Landroid/database/sqlite/SQLiteDatabase;
    .locals 1

    iget-object v0, p0, Lnbisdk/qz;->xP:Landroid/database/sqlite/SQLiteDatabase;

    return-object v0
.end method
